'''
dionysus - a web based dialogue management framework
Copyright (C) 2011  Eugeniu Costetchi <eugeniu.costetchi (at) tudor.lu>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
'''

from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static

# adding dajax
from dajaxice.core import dajaxice_autodiscover
dajaxice_autodiscover()

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # redirect to chat application
    (r'^$', 'account.views.l_redirect', {'location':'/chat/'}),
    # enabling admin, just in case needed
    (r'^admin/', include(admin.site.urls)),
    # the magic application
    url(r'^chat/', include('chat.urls')),
    # static media
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
    # account django serices
    (r'^account/login/$', 'django.contrib.auth.views.login', {'template_name': 'account/login.html'}),
    (r'^account/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'account/logout.html'}),
    (r'^account/signup/$', 'account.views.signup', {'template_name': 'account/signup.html'}),
    (r'^help/$', 'account.views.help', {'template_name':'help.html'}),
    #dajaxice config
    (r'^%s/' % settings.DAJAXICE_MEDIA_PREFIX, include('dajaxice.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
